home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
wildhearts_stage_dive.swf
/
scripts
/
DefineSprite_160
/
frame_1
/
DoAction_2.as
next >
Wrap
Text File
|
2011-08-19
|
713b
|
30 lines
function formatNumber(value, precision)
{
var _loc1_ = undefined;
if(precision > 0)
{
var _loc5_ = Math.pow(10,precision);
_loc1_ = (Math.round(value * _loc5_) / _loc5_).toString();
if(_loc1_.length > 0)
{
var _loc4_ = _loc1_.lastIndexOf(".");
var _loc2_ = 0;
if(_loc4_ < 0)
{
_loc1_ += ".";
_loc2_ = precision;
}
else
{
_loc2_ = precision - (_loc1_.length - (_loc4_ + 1));
}
_loc1_ += "0000000000000000000000000000".substring(0,_loc2_);
}
}
else
{
_loc1_ = Math.round(value).toString();
}
return _loc1_;
}